package com.hutao.manage.service;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.ibatis.annotations.Param;

import com.hutao.manage.pojo.TreatmentTrace;
import com.hutao.manage.pojo.cust.HospitalizationNoteBasic;
import com.hutao.manage.pojo.cust.MedicalRecordPrinterImage;
import com.hutao.manage.query.MedRecordQuery;
import com.hutao.manage.query.MedTraceQuery;
import com.hutao.manage.query.MedVisitUrgeQuery;
import com.hutao.manage.query.MedicalSearchQuery;

public interface MedRecordService {

	
	List<Map<String,Object>> getHospitalizationNoteList(MedRecordQuery params);
	
	/**
	 * 获取已编页的病案
	 * @param params
	 * @return
	 */
	List<Map<String,Object>> getHospitalizationNoteOfPrinterList(MedRecordQuery params);
	
	List<Map<String,Object>> getHospitalizationNoteByFirstGuid(String firstGuid);
	
	/**
     * 依据就诊Guid获取住院基本信息
     * @param firstGuid
     * @return
     */
	List<Map<String,Object>> getHospitalizationNoteBasicByFirstGuid(String firstGuid);
	
	
	List<Map<String,Object>> getScanFiles(String firstGuid);
	
	int getHospitalizationNoteCount(MedRecordQuery params);
	
	int getHospitalizationNoteCountOfPrinter(MedRecordQuery params);
	
	int removeMedRecordImage(String firstGuid,String fileHash);
	
	int paginationMedrecordImage(String firstGuid,String fileHash,Integer mrPageTypeId);
	
	int updateHospitalizationNoteBasic(HospitalizationNoteBasic noteBasic);
	
	List<MedicalRecordPrinterImage> getMedicalRecordPrinterImages(String firstGuid,Integer printerTypeId);
	
	List<MedicalRecordPrinterImage> getPreviewMedicalRecordImages(String firstGuid);
	
	void addTreatmentTrace(String firstGuid,String userId,Integer traceTypeId);
	
	Map<String, Object> statisticsMedRecordOfPigeonhole(MedTraceQuery medRecordQuery,int beyondDay);
	
	int addSimpleMedRecord(HospitalizationNoteBasic hospitalNote,String currentUser);
	
	List<Map<String,Object>> getUnPigeonhole(MedRecordQuery params);
	
	int getUnPigeonholeCount(MedRecordQuery params);
	
	List<Map<String,Object>> getPigeonholed(MedRecordQuery params);
	
	//导出病案借阅到excel
    List<Map<String,Object>> exportBorrowToExcel(MedRecordQuery params);
	
	List<Map<String,Object>> exportUnPigeonholeToExcel(MedRecordQuery params);
	
	int getPigeonholedCount(MedRecordQuery params);
	
	List<Map<String,Object>> getPigeonholeCheck(MedTraceQuery params);
	
	int medicalVisitUrge(String[] urgeGuids, String userId, String byUrgeUserPhone);
	
	
	List<Map<String,Object>> getMedicalVisitOfUrge(MedVisitUrgeQuery params);
	
	
	int addQualityTrace(TreatmentTrace treatmentTrace);
	
	
    /**
     * 病案上传查询病案信息
     * @param medicalSearchQuery
     * @return
     */
    List<Map<String,Object>> getMedRecordList(MedicalSearchQuery medicalSearchQuery);
    
    
    /**
     * 病案上传查询病案信息总数
     * @param medicalSearchQuery
     * @return
     */
    int getMedRecordListCount(MedicalSearchQuery medicalSearchQuery);
    
    
    /**
     * 根据firstGuid查询住院病案信息
     * @param firstGuid
     * @return
     */
    Map<String,Object> getHospitalNoteByFirstGuid(String firstGuid);
    
    List<Map<String,Object>> getHospitalizationNoteOfHomePageList(MedRecordQuery params);
	
    int getHospitalizationNoteOfHomePageCount(MedRecordQuery params);
    
    String diagAssociationCode(String diagCodes);

    //病案上架分页
    List<Map<String, Object>> getHospitalizationNotePutAway_Page(MedRecordQuery params);

    int getHospitalizationNotePutAway_count(MedRecordQuery params);

    List<Map<String, Object>> getMedicalSearchListPage(Map<String, Object> params);
    
    int getMedicalSearchCountPage(Map<String, Object> params);
    
    
    boolean medicalResourceIsExist(String firstGuid, String fileHash);

	int addSpecialMark(Integer noteId);
	
	//缺项分页统计
    List<Map<String, Object>> getLacunaStatisticsPage(MedRecordQuery params);
   
    //缺项分页统计总页数
    int getLacunaStatisticsCountPage(MedRecordQuery params);
    
    //某份病案的编目缺少项
    String getLacunaCodeStrByFirstGuid(String firstGuid);

	int updateMedResource(String firstGuid, String fileHash, Integer status);

	void deleteMedicalRecord(String firstGuid);
	
	void updateScanFilrOriginalName(String fileHash,String preOriginalName);
	
	
	int isHaveNopage(String firstGuid);
	
    List<Map<String, Object>> getHospNoteByMrIdAndVisitNumber(String mrId, String vistiNumber);
    
    Set<Integer> batchPaginationMedrecordImage(String medicalResourceJsonStr, Integer mrPageTypeId, String firstGuid);
    
    
    



}
